// default package
// Generated 28 Jul, 2014 8:04:07 PM by Hibernate Tools 3.4.0.CR1
package com.galaxy.bean;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Review generated by hbm2java
 */
@Entity
@Table(name = "review", catalog = "magento")
public class Review implements java.io.Serializable {
	private static final long serialVersionUID = 121323L;

	private Long reviewId;
	private ReviewEntity reviewEntity;
	private ReviewStatus reviewStatus;
	private Date createdAt;
	private int entityPkValue;
	private Set reviewDetails = new HashSet(0);
	private Set coreStores = new HashSet(0);
	private Set ratingOptionVotes = new HashSet(0);

	public Review() {
	}

	public Review(ReviewEntity reviewEntity, ReviewStatus reviewStatus,
			Date createdAt, int entityPkValue) {
		this.reviewEntity = reviewEntity;
		this.reviewStatus = reviewStatus;
		this.createdAt = createdAt;
		this.entityPkValue = entityPkValue;
	}

	public Review(ReviewEntity reviewEntity, ReviewStatus reviewStatus,
			Date createdAt, int entityPkValue, Set reviewDetails,
			Set coreStores, Set ratingOptionVotes) {
		this.reviewEntity = reviewEntity;
		this.reviewStatus = reviewStatus;
		this.createdAt = createdAt;
		this.entityPkValue = entityPkValue;
		this.reviewDetails = reviewDetails;
		this.coreStores = coreStores;
		this.ratingOptionVotes = ratingOptionVotes;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "review_id", unique = true, nullable = false)
	public Long getReviewId() {
		return this.reviewId;
	}

	public void setReviewId(Long reviewId) {
		this.reviewId = reviewId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "entity_id", nullable = false)
	public ReviewEntity getReviewEntity() {
		return this.reviewEntity;
	}

	public void setReviewEntity(ReviewEntity reviewEntity) {
		this.reviewEntity = reviewEntity;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "status_id", nullable = false)
	public ReviewStatus getReviewStatus() {
		return this.reviewStatus;
	}

	public void setReviewStatus(ReviewStatus reviewStatus) {
		this.reviewStatus = reviewStatus;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "created_at", nullable = false, length = 19)
	public Date getCreatedAt() {
		return this.createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	@Column(name = "entity_pk_value", nullable = false)
	public int getEntityPkValue() {
		return this.entityPkValue;
	}

	public void setEntityPkValue(int entityPkValue) {
		this.entityPkValue = entityPkValue;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "review")
	public Set getReviewDetails() {
		return this.reviewDetails;
	}

	public void setReviewDetails(Set reviewDetails) {
		this.reviewDetails = reviewDetails;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "review_store", catalog = "magento", joinColumns = { @JoinColumn(name = "review_id", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "store_id", nullable = false, updatable = false) })
	public Set getCoreStores() {
		return this.coreStores;
	}

	public void setCoreStores(Set coreStores) {
		this.coreStores = coreStores;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "review")
	public Set getRatingOptionVotes() {
		return this.ratingOptionVotes;
	}

	public void setRatingOptionVotes(Set ratingOptionVotes) {
		this.ratingOptionVotes = ratingOptionVotes;
	}

}
